package com.jprocms.module.cms.api;

import com.jpro.framework.common.pojo.CommonResult;
import com.jprocms.module.cms.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 流程实例 Api 接口
 *
 * @author jprocms
 */
@FeignClient(name = ApiConstants.NAME)
@Tag(name = "RPC 服务 - 内容管理")
public interface ContentApi {

    /**
     * 更新审核结果（提供给外部）
     *
     * @param id 内容ID
     * @param result 审核结果
     * @return 更新结果是否成功
     */
    String PREFIX = ApiConstants.PREFIX + "/content";

    @PostMapping(PREFIX + "/updateAuditResult")
    @Parameters({
            @Parameter(name = "id", description = "内容ID", required = true),
            @Parameter(name = "result", description = "审核结果", required = true)}
    )
    CommonResult<Boolean> updateAuditResult(@RequestParam(name = "id") Long id, @RequestParam(name = "result") Integer result);

}
